<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePetCertificatesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pet_certificates', function (Blueprint $table) {
            $table->id();
            $table->integer('peid')->default(0)->comment('宠物ID');
            $table->integer('type')->default(0)->comment('证书类型');
            $table->tinyInteger('status')->default(0)->comment('审核状态');
            $table->string('path', 256)->default('')->comment('证书路径');
            $table->timestamps();
            $table->index('peid');
            $table->index('type');
            $table->index('status');
        });
        DB::statement("ALTER TABLE `pet_certificates` comment '宠物证书表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('pet_certificates');
    }
}
